package com.mcptt.config;

import com.cloudptt.api.product.ILanChange;
import com.cloudptt.api.product.config.lbs.LocationConfig;
import com.cloudptt.api.product.func.call.CallTimer;
import com.cloudptt.api.product.func.sys.IRestartServer;
import com.cloudptt.api.product.log.Log;
import com.mcptt.config.local.SysConfig;
import com.mcptt.config.model.McIdInfo;
import com.mcptt.config.model.ServerInfo;

import android.content.Context;

public class ConfigCenter
{
	private SysConfig sysConfig = null;
	private LocationConfig locationConfig = null;
	private DbOperatorManager dbOperatorManager = null;

	//	private AddrOperator addrOperator = null;
	//	private MsgOperator msgOperator = null;
	private ConfigListener listener = null;

	private Context ctx = null;
	public ConfigCenter(Context ctx,ILanChange lanChange)
	{
		this.ctx = ctx;
		this.sysConfig = new SysConfig(ctx,lanChange);
		this.locationConfig = new LocationConfig(ctx);
		this.dbOperatorManager = new DbOperatorManager(ctx);
		//		this.configFilesManager = new ConfigFilesManager(ctx,dbOperatorManager,initCallBack);
		//
		//		this.addrOperator = new AddrOperator(ctx,dbOperatorManager.getDbOperator());
		//		this.msgOperator = new MsgOperator(dbOperatorManager.getDbOperator().getHistoryDbOperator());
	}

	public SysConfig getSysConfig()
	{
		return sysConfig;
	}

	public LocationConfig getLocationConfig() {
		return locationConfig;
	}
	

	public CallConfig getDefaultCallConfig()
	{
		CallTimer callTimer = CallTimer.getInstance();
//		CallPriority callPriority =  CallPriority.getDefaultCallPriority();
		return new CallConfig(callTimer);
	}

	public DbOperatorManager getDbOperatorManager() {
		return dbOperatorManager;
	}
	
	public void deleteAllGroupUser()
	{
		if(dbOperatorManager != null)
		{
			dbOperatorManager.getAddrDbOperator().deleteAllGroupUser();
		}
	}

}
